3.7.99 \(\int \frac {(a+i a \tan (e+f x))^3 (A+B \tan (e+f x))}{(c-i c \tan (e+f x))^3} \, dx\) [699]

Optimal. Leaf size=129 \[ \frac {i a^3 B x}{c^3}+\frac {a^3 B \log (\cos (e+f x))}{c^3 f}-\frac {a^3 (i A+B) (1+i \tan (e+f x))^3}{6 c^3 f (1-i \tan (e+f x))^3}-\frac {2 a^3 B}{c^3 f (i+\tan (e+f x))^2}-\frac {4 i a^3 B}{c^3 f (i+\tan (e+f x))} \]

[Out]

I*a^3*B*x/c^3+a^3*B*ln(cos(f*x+e))/c^3/f-1/6*a^3*(I*A+B)*(1+I*tan(f*x+e))^3/c^3/f/(1-I*tan(f*x+e))^3-2*a^3*B/c
^3/f/(I+tan(f*x+e))^2-4*I*a^3*B/c^3/f/(I+tan(f*x+e))

________________________________________________________________________________________

Rubi [A]
time = 0.10, antiderivative size = 129, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 41, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.073, Rules used = {3669, 79, 45} \begin {gather*} -\frac {a^3 (B+i A) (1+i \tan (e+f x))^3}{6 c^3 f (1-i \tan (e+f x))^3}-\frac {4 i a^3 B}{c^3 f (\tan (e+f x)+i)}-\frac {2 a^3 B}{c^3 f (\tan (e+f x)+i)^2}+\frac {a^3 B \log (\cos (e+f x))}{c^3 f}+\frac {i a^3 B x}{c^3} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[((a + I*a*Tan[e + f*x])^3*(A + B*Tan[e + f*x]))/(c - I*c*Tan[e + f*x])^3,x]

[Out]

(I*a^3*B*x)/c^3 + (a^3*B*Log[Cos[e + f*x]])/(c^3*f) - (a^3*(I*A + B)*(1 + I*Tan[e + f*x])^3)/(6*c^3*f*(1 - I*T
an[e + f*x])^3) - (2*a^3*B)/(c^3*f*(I + Tan[e + f*x])^2) - ((4*I)*a^3*B)/(c^3*f*(I + Tan[e + f*x]))

Rule 45

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 79

Int[((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Simp[(-(b*e - a*f
))*(c + d*x)^(n + 1)*((e + f*x)^(p + 1)/(f*(p + 1)*(c*f - d*e))), x] - Dist[(a*d*f*(n + p + 2) - b*(d*e*(n + 1
) + c*f*(p + 1)))/(f*(p + 1)*(c*f - d*e)), Int[(c + d*x)^n*(e + f*x)^(p + 1), x], x] /; FreeQ[{a, b, c, d, e,
f, n}, x] && LtQ[p, -1] && ( !LtQ[n, -1] || IntegerQ[p] ||  !(IntegerQ[n] ||  !(EqQ[e, 0] ||  !(EqQ[c, 0] || L
tQ[p, n]))))

Rule 3669

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)])*((c_) + (d_.)*tan[(e_
.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[a*(c/f), Subst[Int[(a + b*x)^(m - 1)*(c + d*x)^(n - 1)*(A + B*x), x
], x, Tan[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, A, B, m, n}, x] && EqQ[b*c + a*d, 0] && EqQ[a^2 + b^2, 0]

Rubi steps

\begin {align*} \int \frac {(a+i a \tan (e+f x))^3 (A+B \tan (e+f x))}{(c-i c \tan (e+f x))^3} \, dx &=\frac {(a c) \text {Subst}\left (\int \frac {(a+i a x)^2 (A+B x)}{(c-i c x)^4} \, dx,x,\tan (e+f x)\right )}{f}\\ &=-\frac {a^3 (i A+B) (1+i \tan (e+f x))^3}{6 c^3 f (1-i \tan (e+f x))^3}+\frac {(i a B) \text {Subst}\left (\int \frac {(a+i a x)^2}{(c-i c x)^3} \, dx,x,\tan (e+f x)\right )}{f}\\ &=-\frac {a^3 (i A+B) (1+i \tan (e+f x))^3}{6 c^3 f (1-i \tan (e+f x))^3}+\frac {(i a B) \text {Subst}\left (\int \left (-\frac {4 i a^2}{c^3 (i+x)^3}+\frac {4 a^2}{c^3 (i+x)^2}+\frac {i a^2}{c^3 (i+x)}\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {i a^3 B x}{c^3}+\frac {a^3 B \log (\cos (e+f x))}{c^3 f}-\frac {a^3 (i A+B) (1+i \tan (e+f x))^3}{6 c^3 f (1-i \tan (e+f x))^3}-\frac {2 a^3 B}{c^3 f (i+\tan (e+f x))^2}-\frac {4 i a^3 B}{c^3 f (i+\tan (e+f x))}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 1.65, size = 167, normalized size = 1.29 \begin {gather*} \frac {a^3 \left (-3 B \cos (e+f x)+\cos (3 (e+f x)) \left (-i A-B+6 i B f x+3 B \log \left (\cos ^2(e+f x)\right )\right )+9 i B \sin (e+f x)+A \sin (3 (e+f x))-i B \sin (3 (e+f x))+6 B f x \sin (3 (e+f x))-3 i B \log \left (\cos ^2(e+f x)\right ) \sin (3 (e+f x))\right ) (\cos (3 (e+2 f x))+i \sin (3 (e+2 f x)))}{6 c^3 f (\cos (f x)+i \sin (f x))^3} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[((a + I*a*Tan[e + f*x])^3*(A + B*Tan[e + f*x]))/(c - I*c*Tan[e + f*x])^3,x]

[Out]

(a^3*(-3*B*Cos[e + f*x] + Cos[3*(e + f*x)]*((-I)*A - B + (6*I)*B*f*x + 3*B*Log[Cos[e + f*x]^2]) + (9*I)*B*Sin[
e + f*x] + A*Sin[3*(e + f*x)] - I*B*Sin[3*(e + f*x)] + 6*B*f*x*Sin[3*(e + f*x)] - (3*I)*B*Log[Cos[e + f*x]^2]*
Sin[3*(e + f*x)])*(Cos[3*(e + 2*f*x)] + I*Sin[3*(e + 2*f*x)]))/(6*c^3*f*(Cos[f*x] + I*Sin[f*x])^3)

________________________________________________________________________________________

Maple [A]
time = 0.30, size = 88, normalized size = 0.68

method result size
derivativedivides \(\frac {a^{3} \left (-\frac {5 i B -A}{i+\tan \left (f x +e \right )}-\frac {-4 i B +4 A}{3 \left (i+\tan \left (f x +e \right )\right )^{3}}-\frac {4 i A +8 B}{2 \left (i+\tan \left (f x +e \right )\right )^{2}}-B \ln \left (i+\tan \left (f x +e \right )\right )\right )}{f \,c^{3}}\) \(88\)
default \(\frac {a^{3} \left (-\frac {5 i B -A}{i+\tan \left (f x +e \right )}-\frac {-4 i B +4 A}{3 \left (i+\tan \left (f x +e \right )\right )^{3}}-\frac {4 i A +8 B}{2 \left (i+\tan \left (f x +e \right )\right )^{2}}-B \ln \left (i+\tan \left (f x +e \right )\right )\right )}{f \,c^{3}}\) \(88\)
risch \(-\frac {{\mathrm e}^{6 i \left (f x +e \right )} B \,a^{3}}{6 c^{3} f}-\frac {i {\mathrm e}^{6 i \left (f x +e \right )} A \,a^{3}}{6 c^{3} f}+\frac {B \,a^{3} {\mathrm e}^{4 i \left (f x +e \right )}}{2 c^{3} f}-\frac {B \,a^{3} {\mathrm e}^{2 i \left (f x +e \right )}}{c^{3} f}-\frac {2 i B \,a^{3} e}{c^{3} f}+\frac {B \,a^{3} \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )}{c^{3} f}\) \(124\)
norman \(\frac {\frac {\left (-i B \,a^{3}+A \,a^{3}\right ) \tan \left (f x +e \right )}{c f}+\frac {\left (-5 i B \,a^{3}+A \,a^{3}\right ) \left (\tan ^{5}\left (f x +e \right )\right )}{c f}+\frac {i B \,a^{3} x}{c}+\frac {i B \,a^{3} x \left (\tan ^{6}\left (f x +e \right )\right )}{c}-\frac {i A \,a^{3}+7 B \,a^{3}}{3 c f}-\frac {2 \left (i B \,a^{3}+5 A \,a^{3}\right ) \left (\tan ^{3}\left (f x +e \right )\right )}{3 c f}-\frac {\left (-2 i A \,a^{3}+6 B \,a^{3}\right ) \left (\tan ^{2}\left (f x +e \right )\right )}{c f}-\frac {3 \left (i A \,a^{3}+3 B \,a^{3}\right ) \left (\tan ^{4}\left (f x +e \right )\right )}{c f}+\frac {3 i B \,a^{3} x \left (\tan ^{2}\left (f x +e \right )\right )}{c}+\frac {3 i B \,a^{3} x \left (\tan ^{4}\left (f x +e \right )\right )}{c}}{c^{2} \left (1+\tan ^{2}\left (f x +e \right )\right )^{3}}-\frac {B \,a^{3} \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2 c^{3} f}\) \(276\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+I*a*tan(f*x+e))^3*(A+B*tan(f*x+e))/(c-I*c*tan(f*x+e))^3,x,method=_RETURNVERBOSE)

[Out]

1/f*a^3/c^3*(-(-A+5*I*B)/(I+tan(f*x+e))-1/3*(-4*I*B+4*A)/(I+tan(f*x+e))^3-1/2*(4*I*A+8*B)/(I+tan(f*x+e))^2-B*l
n(I+tan(f*x+e)))

________________________________________________________________________________________

Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: RuntimeError} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))^3*(A+B*tan(f*x+e))/(c-I*c*tan(f*x+e))^3,x, algorithm="maxima")

[Out]

Exception raised: RuntimeError >> ECL says: Error executing code in Maxima: expt: undefined: 0 to a negative e
xponent.

________________________________________________________________________________________

Fricas [A]
time = 5.15, size = 81, normalized size = 0.63 \begin {gather*} \frac {{\left (-i \, A - B\right )} a^{3} e^{\left (6 i \, f x + 6 i \, e\right )} + 3 \, B a^{3} e^{\left (4 i \, f x + 4 i \, e\right )} - 6 \, B a^{3} e^{\left (2 i \, f x + 2 i \, e\right )} + 6 \, B a^{3} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right )}{6 \, c^{3} f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))^3*(A+B*tan(f*x+e))/(c-I*c*tan(f*x+e))^3,x, algorithm="fricas")

[Out]

1/6*((-I*A - B)*a^3*e^(6*I*f*x + 6*I*e) + 3*B*a^3*e^(4*I*f*x + 4*I*e) - 6*B*a^3*e^(2*I*f*x + 2*I*e) + 6*B*a^3*
log(e^(2*I*f*x + 2*I*e) + 1))/(c^3*f)

________________________________________________________________________________________

Sympy [A]
time = 0.48, size = 212, normalized size = 1.64 \begin {gather*} \frac {B a^{3} \log {\left (e^{2 i f x} + e^{- 2 i e} \right )}}{c^{3} f} + \begin {cases} \frac {6 B a^{3} c^{6} f^{2} e^{4 i e} e^{4 i f x} - 12 B a^{3} c^{6} f^{2} e^{2 i e} e^{2 i f x} + \left (- 2 i A a^{3} c^{6} f^{2} e^{6 i e} - 2 B a^{3} c^{6} f^{2} e^{6 i e}\right ) e^{6 i f x}}{12 c^{9} f^{3}} & \text {for}\: c^{9} f^{3} \neq 0 \\\frac {x \left (A a^{3} e^{6 i e} - i B a^{3} e^{6 i e} + 2 i B a^{3} e^{4 i e} - 2 i B a^{3} e^{2 i e}\right )}{c^{3}} & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))**3*(A+B*tan(f*x+e))/(c-I*c*tan(f*x+e))**3,x)

[Out]

B*a**3*log(exp(2*I*f*x) + exp(-2*I*e))/(c**3*f) + Piecewise(((6*B*a**3*c**6*f**2*exp(4*I*e)*exp(4*I*f*x) - 12*
B*a**3*c**6*f**2*exp(2*I*e)*exp(2*I*f*x) + (-2*I*A*a**3*c**6*f**2*exp(6*I*e) - 2*B*a**3*c**6*f**2*exp(6*I*e))*
exp(6*I*f*x))/(12*c**9*f**3), Ne(c**9*f**3, 0)), (x*(A*a**3*exp(6*I*e) - I*B*a**3*exp(6*I*e) + 2*I*B*a**3*exp(
4*I*e) - 2*I*B*a**3*exp(2*I*e))/c**3, True))

________________________________________________________________________________________

Giac [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 255 vs. \(2 (118) = 236\).
time = 1.01, size = 255, normalized size = 1.98 \begin {gather*} \frac {\frac {30 \, B a^{3} \log \left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 1\right )}{c^{3}} - \frac {60 \, B a^{3} \log \left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + i\right )}{c^{3}} + \frac {30 \, B a^{3} \log \left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 1\right )}{c^{3}} + \frac {147 \, B a^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{6} - 60 \, A a^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{5} + 942 i \, B a^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{5} - 2445 \, B a^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} + 200 \, A a^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} - 3620 i \, B a^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} + 2445 \, B a^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 60 \, A a^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 942 i \, B a^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 147 \, B a^{3}}{c^{3} {\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + i\right )}^{6}}}{30 \, f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))^3*(A+B*tan(f*x+e))/(c-I*c*tan(f*x+e))^3,x, algorithm="giac")

[Out]

1/30*(30*B*a^3*log(tan(1/2*f*x + 1/2*e) + 1)/c^3 - 60*B*a^3*log(tan(1/2*f*x + 1/2*e) + I)/c^3 + 30*B*a^3*log(t
an(1/2*f*x + 1/2*e) - 1)/c^3 + (147*B*a^3*tan(1/2*f*x + 1/2*e)^6 - 60*A*a^3*tan(1/2*f*x + 1/2*e)^5 + 942*I*B*a
^3*tan(1/2*f*x + 1/2*e)^5 - 2445*B*a^3*tan(1/2*f*x + 1/2*e)^4 + 200*A*a^3*tan(1/2*f*x + 1/2*e)^3 - 3620*I*B*a^
3*tan(1/2*f*x + 1/2*e)^3 + 2445*B*a^3*tan(1/2*f*x + 1/2*e)^2 - 60*A*a^3*tan(1/2*f*x + 1/2*e) + 942*I*B*a^3*tan
(1/2*f*x + 1/2*e) - 147*B*a^3)/(c^3*(tan(1/2*f*x + 1/2*e) + I)^6))/f

________________________________________________________________________________________

Mupad [B]
time = 8.97, size = 141, normalized size = 1.09 \begin {gather*} -\frac {a^3\,\left (15\,B\,{\mathrm {tan}\left (e+f\,x\right )}^2-7\,B+B\,\mathrm {tan}\left (e+f\,x\right )\,18{}\mathrm {i}+A\,{\mathrm {tan}\left (e+f\,x\right )}^2\,3{}\mathrm {i}-A\,1{}\mathrm {i}-3\,B\,\ln \left (\mathrm {tan}\left (e+f\,x\right )+1{}\mathrm {i}\right )+B\,\ln \left (\mathrm {tan}\left (e+f\,x\right )+1{}\mathrm {i}\right )\,\mathrm {tan}\left (e+f\,x\right )\,9{}\mathrm {i}+9\,B\,\ln \left (\mathrm {tan}\left (e+f\,x\right )+1{}\mathrm {i}\right )\,{\mathrm {tan}\left (e+f\,x\right )}^2-B\,\ln \left (\mathrm {tan}\left (e+f\,x\right )+1{}\mathrm {i}\right )\,{\mathrm {tan}\left (e+f\,x\right )}^3\,3{}\mathrm {i}\right )}{3\,c^3\,f\,{\left (-1+\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )}^3} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((A + B*tan(e + f*x))*(a + a*tan(e + f*x)*1i)^3)/(c - c*tan(e + f*x)*1i)^3,x)

[Out]

-(a^3*(B*tan(e + f*x)*18i - 7*B - A*1i + A*tan(e + f*x)^2*3i + 15*B*tan(e + f*x)^2 - 3*B*log(tan(e + f*x) + 1i
) + B*log(tan(e + f*x) + 1i)*tan(e + f*x)*9i + 9*B*log(tan(e + f*x) + 1i)*tan(e + f*x)^2 - B*log(tan(e + f*x)
+ 1i)*tan(e + f*x)^3*3i))/(3*c^3*f*(tan(e + f*x)*1i - 1)^3)

________________________________________________________________________________________